import pytest


class   TestFruit:
    def __init__(self, name):
        self.name =name

    def __eq__(self, other):
       return self.name == other.name

@pytest.fixture
def my_fruit():
    print("my_fruit函数调用")
    return TestFruit("apple")

@pytest.fixture
def fruit_basket(my_fruit):
    print("fruit_basket函数调用")
    return [TestFruit("banana"), my_fruit]

def test_my_fruit_in_basket(my_fruit, fruit_basket):
    print("test_my_fruit_in_basket函数调用")
    assert my_fruit in fruit_basket
